Skip to content

ci: upgrade npm in release workflow for Trusted Publishing#3

Merged
stevensacks merged 1 commit intomainfrom
ci/upgrade-npm
Apr 27, 2026
Merged

ci: upgrade npm in release workflow for Trusted Publishing#3
stevensacks merged 1 commit intomainfrom
ci/upgrade-npm

Conversation

@stevensacks
Copy link
Copy Markdown
Contributor

Summary

Adds an npm install -g npm@latest step before the changesets publish step.

Why

Trusted Publishing requires the npm CLI to exchange the GitHub OIDC token for a short-lived publish token. That codepath landed in npm 11.5.1. Earlier npm versions (Node 22 ships npm 10) sign provenance attestations but skip the OIDC exchange, so the actual PUT https://registry.npmjs.org/<pkg> request goes without auth and the registry returns 404 — even when the trusted publisher is correctly configured.

Symptom we hit on the v1.1.0 publish:

```
npm notice publish Signed provenance statement
npm notice publish Provenance statement published to transparency log
npm error 404 Not Found - PUT https://registry.npmjs.org/@gaia-react%2flint
```

🤖 Generated with Claude Code

Node 22 ships npm 10.x. npm 10 signs provenance attestations but does
not exchange the GitHub OIDC token for a short-lived publish token,
so PUTs to the registry go without auth and return 404 even when a
trusted publisher is correctly configured. npm 11.5.1+ does the
exchange. Installing npm@latest before the publish step unblocks it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stevensacks stevensacks merged commit fd0d231 into main Apr 27, 2026
1 check passed
@stevensacks stevensacks deleted the ci/upgrade-npm branch April 27, 2026 13:59
stevensacks added a commit that referenced this pull request Apr 27, 2026
PR #3 added `npm install -g npm@latest` but it failed at runtime with
MODULE_NOT_FOUND on promise-retry — a well-known npm self-upgrade
bootstrap bug where modules unload mid-rebuild. `--force` skips the
problematic rebuild step.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant